package o;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import java.util.Queue;

public class vj<A, B> {
    private final aar<d<A>, B> ˋ;

    @VisibleForTesting
    static final class d<A> {
        private static final Queue<d<?>> ˊ = aau.ॱ(0);
        private A ˋ;
        private int ˎ;
        private int ॱ;

        static <A> d<A> ˊ(A a, int i, int i2) {
            d<A> dVar;
            synchronized (ˊ) {
                dVar = (d) ˊ.poll();
            }
            if (dVar == null) {
                dVar = new d();
            }
            dVar.ˋ(a, i, i2);
            return dVar;
        }

        private d() {
        }

        private void ˋ(A a, int i, int i2) {
            this.ˋ = a;
            this.ˎ = i;
            this.ॱ = i2;
        }

        public void ॱ() {
            synchronized (ˊ) {
                ˊ.offer(this);
            }
        }

        public boolean equals(Object obj) {
            if (!(obj instanceof d)) {
                return false;
            }
            d dVar = (d) obj;
            if (this.ˎ == dVar.ˎ && this.ॱ == dVar.ॱ && this.ˋ.equals(dVar.ˋ)) {
                return true;
            }
            return false;
        }

        public int hashCode() {
            return (((this.ॱ * 31) + this.ˎ) * 31) + this.ˋ.hashCode();
        }
    }

    public vj() {
        this(250);
    }

    public vj(long j) {
        this.ˋ = new aar<d<A>, B>(this, j) {
            final /* synthetic */ vj ˋ;

            protected /* synthetic */ void ॱ(@NonNull Object obj, @Nullable Object obj2) {
                ˏ((d) obj, obj2);
            }

            protected void ˏ(@NonNull d<A> dVar, @Nullable B b) {
                dVar.ॱ();
            }
        };
    }

    @Nullable
    public B ˏ(A a, int i, int i2) {
        d ˊ = d.ˊ(a, i, i2);
        B ˏ = this.ˋ.ˏ(ˊ);
        ˊ.ॱ();
        return ˏ;
    }

    public void ˊ(A a, int i, int i2, B b) {
        this.ˋ.ˊ(d.ˊ(a, i, i2), b);
    }
}
